package bdgrade;

import java.awt.EventQueue;

import javax.swing.JFrame;
import java.awt.Color;
import javax.swing.JPanel;

import domain.Stu;
import service.StuService;
import service.Impl.StuServiceImpl;
import tools.ReadTool;

import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JFileChooser;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.util.List;

import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Toolkit;
import java.awt.Window.Type;
import java.awt.Dialog.ModalExclusionType;
import java.awt.Font;

public class BdGrade {
	//主页面
	private JFrame frame;
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					BdGrade window = new BdGrade();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	public BdGrade() {
		initialize();
	}

	//初始化页面
	private void initialize() {
		frame = new JFrame();
		frame.getContentPane().setBackground(Color.BLACK);
//		frame.setIconImage(Toolkit.getDefaultToolkit().getImage(BdGrade.class.getResource("/img/"+imgUrl)));
		frame.setTitle("主页面");
		frame.setBounds(100, 100, 529, 717);
		frame.setResizable(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBounds(0, 0, 511, 82);
		panel.setBackground(Color.BLACK);
		frame.getContentPane().add(panel);
		
		JButton button = new JButton("新增单个");
		button.setForeground(Color.WHITE);
		button.setBackground(Color.BLACK);
		button.setFont(new Font("宋体", Font.PLAIN, 15));
		button.setBounds(249, 28, 101, 41);
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		button.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				//添加按钮点击进入添加界面
				new Add_Gui();		 
			}
		});
		panel.setLayout(null);
		
		JButton button_3 = new JButton("批量导出");
		button_3.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				new DeriveTips();
			}
		});
		button_3.setForeground(Color.WHITE);
		button_3.setBackground(Color.BLACK);
		button_3.setFont(new Font("宋体", Font.PLAIN, 15));
		button_3.setBounds(37, 28, 101, 41);
		panel.add(button_3);
		
		JButton button_1 = new JButton("批量导入");
		button_1.setForeground(Color.WHITE);
		button_1.setBackground(Color.BLACK);
		button_1.setFont(new Font("宋体", Font.PLAIN, 15));
		button_1.setBounds(146, 28, 97, 41);
		button_1.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				new ImportTips();
			}
		});
		panel.add(button_1);
		panel.add(button);
		
		JButton button_2 = new JButton("查询/修改");
		button_2.setForeground(Color.WHITE);
		button_2.setBackground(Color.BLACK);
		button_2.setFont(new Font("宋体", Font.PLAIN, 15));
		button_2.setBounds(358, 28, 110, 41);
		button_2.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				//查询按钮点击进入查询界面
				new Query_Gui();
			}
		});
		panel.add(button_2);
		
		
		
		JPanel panel_1 = new JPanel();
		panel_1.setBounds(0, 95, 445, 575);
		panel_1.setBackground(Color.BLACK);
		frame.getContentPane().add(panel_1);
		panel_1.setLayout(null);
		
		JLabel label = new JLabel("");
		label.setIcon(new ImageIcon(BdGrade.class.getResource("/img/4.jpg")));
		label.setBounds(-118, -132, 657, 694);
		panel_1.add(label);
		
	}
}
